package cn.afterturn.easypoi.word.entity.bookmark;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/*@Data
@ToString(callSuper = true)
@EqualsAndHashCode()*/
@Entity
@Table(name = "rowEntityVO", schema = "jeecg-boot-sjk", catalog = "")
public class RowEntityVO {
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getRowFirstColumnText() {
        return rowFirstColumnText;
    }

    public void setRowFirstColumnText(String rowFirstColumnText) {
        this.rowFirstColumnText = rowFirstColumnText;
    }

    public Set<BookMarkEntityVO> getBookMarkEntityVOS() {
        return bookMarkEntityVOS;
    }

    public void setBookMarkEntityVOS(Set<BookMarkEntityVO> bookMarkEntityVOS) {
        this.bookMarkEntityVOS = bookMarkEntityVOS;
    }

    public int getRowIndex() {
        return rowIndex;
    }

    public void setRowIndex(int rowIndex) {
        this.rowIndex = rowIndex;
    }

    public boolean isLoopIndex() {
        return loopIndex;
    }

    public void setLoopIndex(boolean loopIndex) {
        this.loopIndex = loopIndex;
    }

    public Set<CellEntityVO> getCellEntityVOS() {
        return cellEntityVOS;
    }

    public void setCellEntityVOS(Set<CellEntityVO> cellEntityVOS) {
        this.cellEntityVOS = cellEntityVOS;
    }

   /* public BookMarkEntityVO getBookMarkEntityVO() {
        return bookMarkEntityVO;
    }

    public void setBookMarkEntityVO(BookMarkEntityVO bookMarkEntityVO) {
        this.bookMarkEntityVO = bookMarkEntityVO;
    }*/

    public TableEntityVO getTableEntityVO() {
        return tableEntityVO;
    }

    public void setTableEntityVO(TableEntityVO tableEntityVO) {
        this.tableEntityVO = tableEntityVO;
    }
    @ApiModelProperty(value = "系统解析是自动生成ID")
    @Id
    @Column(name = "id")

    private String id;
    @ApiModelProperty(value = "行的第一列的文本")
    private String rowFirstColumnText;
    @JsonIgnore
    @Transient
    private Set<BookMarkEntityVO> bookMarkEntityVOS=new HashSet<>();//该行形成的循环的bookmark
    @ApiModelProperty(value = "表格中的行号")
    private int rowIndex;
    @ApiModelProperty(value = "该行是否循环false：不循环；true，循环")
    private boolean loopIndex;
    @ApiModelProperty(value = "该行下所有的单元格")
    @JsonIgnoreProperties("rowEntityVO")
    @OneToMany(mappedBy = "rowEntityVO",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    //@org.hibernate.annotations.ForeignKey(name = "none")
    private Set<CellEntityVO> cellEntityVOS=new HashSet<>();


   /* @JsonIgnore
    @Transient
    private BookMarkEntityVO bookMarkEntityVO;//该行单独形成的一个不循环的bookmark.在该版本中没有用这个功能*/

    @JsonIgnoreProperties("rowEntityVOS")
    @ManyToOne(cascade = CascadeType.ALL,optional = false,fetch = FetchType.LAZY)
    @JoinColumn(name = "fid"/*,foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)*/)
    private TableEntityVO tableEntityVO;
}
